package epoch.game.core.common;

/**
 * 操作系统
 * @author will
 *
 */
public enum OS {
	windows,
	linux,
	mac,
	other;
	
	private static String osName = System.getProperty("os.name").toLowerCase();
	
	public static OS getOS(){
		if(osName.indexOf("linux")>=0){
			return OS.linux;
		}else if(osName.indexOf("win")>=0){
			return OS.windows;
		}else if(osName.indexOf("mac")>=0){
			return OS.mac;
		}else{
			return OS.other;
		}
	}
	
	public static boolean isWin(){
		return OS.windows == getOS();
	}
	
	public static boolean isLinux(){
		return OS.linux == getOS();
	}
	
	public static boolean isMac(){
		return OS.mac == getOS();
	}
}
